package com.example.api.mall.component;

import lombok.Data;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @name: Person
 * @description: 获取配置
 * @author: xw.s
 * @date: 2021/5/31-14:14
 */
@Configuration
@ConfigurationProperties(prefix = "person")
//@PropertySource(value = "classpath:person.properties") //自定义配置文件
@ToString
@Data
public class Person {
//    @Value("${person.name}")
    private String name;
//    @Value("${person.email}")
    private String email;
}
